"use client";
import {
  CategoryScale,
  Chart,
  LineElement,
  LinearScale,
  PointElement,
  Tooltip,
} from "chart.js";
import { Line } from "react-chartjs-2";

Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Tooltip);

type Props = {
  labels: string[];
  data: number[];
};

const MyLineChart = ({ labels, data }: Props) => {
  return (
    <Line
      width={500}
      height={500}
      data={{
        labels,
        datasets: [
          {
            data,
            borderColor: "#d3ad7f",
          },
        ],
      }}
    />
  );
};
export default MyLineChart;
